#include <stdio.h>
#include <unistd.h>
#include <signal.h>

int mysleep (int s);
void handler(int s)
{
		printf("lalala...\n");
}
int main(int argc, char **argv)
{
	int s = 0;
	signal (SIGALRM,handler);
	printf("请输入等待时间：\n");
	scanf("%d",&s);
	while(1){
		mysleep(s);
	}
	return 0;
}
int mysleep (int s)
{
	alarm(s);
	pause();
	return (alarm(0));
}
